package yxy.cherry.battle.module.record.stream;

import java.util.ArrayList;

public class RecordStreamGroup extends RecordStream {

	ArrayList<RecordStream> list = new ArrayList<>();

	public void record() {
		for (RecordStream stream : list) {
			stream.record();
		}
	}

	@Override
	protected void _record() {
	}

	public <R extends RecordStream> R add(R recordStream) {
		list.add(recordStream);
		return recordStream;
	}

	@Override
	public String info() {
		StringBuffer sb = new StringBuffer();
		for (RecordStream stream : list) {
			sb.append(stream.info());
		}
		return sb.toString();
	}

}
